#pragma  once

#include <string>

template<typename T>
void WriteMemoryToFile(const T* i_buffer, const size_t i_size, const std::string& i_filename)
  {
  FILE* p_file = fopen(i_filename.c_str(), "wb");
  fwrite(&i_size, sizeof(size_t), 1, p_file);
  fwrite(i_buffer, sizeof(T), i_size*i_size, p_file);
  fclose(p_file);
  }